import axios from "axios";
const BASE_URL = 'http://101.43.196.222:9009'
const HR_URL = `${BASE_URL}/hr.service`
const TOKEN_TO_HR = 'tokenToHrId'
const LOG_OUT = 'loginout'


export default {
    redisTokenToHR, logout,getHrById
}
function getHrById(hr_id){
    return axios.get(
        `${HR_URL}/hr/${hr_id}`,
    )
}
function redisTokenToHR(token) {
    return axios.get(
        `${HR_URL}/${TOKEN_TO_HR}`,
        {
            headers: { 'HR_TOKEN': token }
        }
    )
}
function logout() {
    return axios.create({
        headers: {
            'HR_TOKEN': token
        }
    }).get(
        `${HR_URL}/${LOG_OUT}`
    )
}